fix: clamp logderivative inverse range to fix nightly debug build OOB#22312
Draft
fix: clamp logderivative inverse range to fix nightly debug build OOB#22312
Conversation
f47dc94 to
46d1d71
Compare
46d1d71 to
3da2230
Compare
3da2230 to
e2886cd
Compare
09f9ec4 to
8b8ea8c
Compare
In compute_logderivative_inverse(), the multithreaded path partitions work by circuit_size but inverse_polynomial.coeffs() can be smaller than circuit_size (virtual zero elements). When a thread chunk's start exceeds the polynomial's actual data size, coeffs()[start] is out of bounds -- caught by _GLIBCXX_DEBUG's span bounds checking in the debug build. Fix: clamp start/end to the polynomial's actual data range before calling batch_invert. Virtual zero elements need no inversion.
8b8ea8c to
fc319eb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes nightly barretenberg debug build which crashes with SIGABRT (exit code 134) in test
AvmRecursiveTests.TwoLayerAvmRecursionFailsWithWrongPIs.Root cause: In
compute_logderivative_inverse(), the multi-threaded path splits work bycircuit_size, butinverse_polynomial.coeffs()only covers the actual (non-virtual) data. When a thread chunk'sstartexceeds the polynomial's actual size,coeffs()[start]is out of bounds — caught by_GLIBCXX_DEBUG's span bounds checking in the debug build preset.Fix: Clamp
start/endto the polynomial's actual data range beforebatch_invert. Virtual zero elements need no inversion.Note: The
batch_invertreserve→resize fix from the original PR #22312 is no longer needed as it was already applied onnext. PR #22314 can be closed as duplicate.